#include "stack.h"
#include <stdlib.h>

//新建栈
CHRT_STACK Chvm_New_Stack(int32 size)
{
    CHRT_STACK stack = (CHRT_STACK)malloc(
        STRUCT_SIZE(CHRT_STACK) +
        sizeof(CHRT_STACK_ELEM) * size);
    stack->ElemCount = size;   
    stack->StackTop = stack->StackStart;
    return stack;
}